<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace common\helpers;

/**
 * Description of CommonHelper
 *
 * @author Sylar
 */
class CommonHelper extends \yii\base\Component{
    
    public static function arrayToString($errors) {
        $string = '';
        foreach ($errors as $k => $v) {
            if (is_array($v)) {
                $string .= self::arrayToString($v);
            }
            else {
                $string .= (is_numeric($k) ? '' : $k . ':');
                $string .= $v;
                $string .= "\n";
            }
        }
        return $string;
    }
}
